<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/popper.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>

<script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
<script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
</head>
<style type="text/css">
.btn {
	text-align: center;
	height: 30px;
	line-height: 30px;
	border-radius: 5px;
	cursor: pointer;
	background-color: cornflowerblue;
	color: block;
	margin: 0 auto;
}
</style>
<body>
<div id="abc">
<div class="uc_title m_10 tabs_menu">
	<label class="current node"><span>基本信息完善</span></label>
</div>
	<table style="border: 1px; margin: 0 auto; background: snow"
		width="80%" height="300px" cellpadding="5" cellspacing="0">
		<tr>
			<td>昵称</td>
			<td><input type="text" style="width: 95%" v-model="nickname"></td>
			<td>风格</td>
			<td><select style="width: 96%" v-model="style">
					<option value="1">健美</option>
					<option value="2">健力</option>
					<option value="3">体操</option>
					<option value="4">体能</option>
			</select></td>
		</tr>
		<tr>
			<td>信息是否公开</td>
			<td><select style="width: 96%" v-model="isOpen">
					<option value="1">公开</option>
					<option value="0">不公开</option>
			</select></td>
			<td>是否选择接课</td>
			<td><select style="width: 96%" v-model="isAccept">
					<option value="1">接课</option>
					<option value="0">不接课</option>
			</select></td>
		</tr>
		<tr>
			<td>是否已于场馆签约</td>
			<td><select style="width: 96%" v-model="isBand">
					<option value="1">已签约</option>
					<option value="0">未签约</option>
			</select></td>
			<td>是否满课</td>
			<td><select style="width: 96%" v-model="isFull">
					<option value="0">满课</option>
					<option value="1">未满课</option>
			</select></td>
		</tr>
		<tr>
			<td>是否接私教</td>
			<td><select style="width: 96%" v-model="isPrivate">
					<option value="1">是</option>
					<option value="0">否</option>
			</select></td>
			<td>课时费</td>
			<td><input style="width: 95%;" type="text" v-model="price"></td>
		</tr>
		<tr>
			<td colspan="4" align="right"><input type="submit" @click="onSubmit()"  class="btn" value="提交">
		</tr>
	</table>
	</div>
	<script type="text/javascript">
	new Vue({
		el:"#abc",
	data(){
			return{
				nickname:"",
				style:1,
				isOpen:1,
				isAccept:1,
				isBand:1,
				isFull:1,
				isPrivate:1,
				price:""
			}
	},
		methods:{
			onSubmit:function(){
				//alert(id);
				console.log(this.style);
				var params =new URLSearchParams();
				console.log(this.style);
				params.append("nickname",this.nickname);
				params.append("styleId",this.style);
				params.append("isOpen",this.isOpen);
				params.append("isAccept",this.isAccept);
				params.append("isBand",this.isBand);
				params.append("isFull",this.isFull);
				params.append("isPrivate",this.isPrivate);
				params.append("price",this.price);
				axios.post(
					"/coach/updateCoachInformation",	
					params
				).then(res=>{
					if(res.data.code==500){
						location.href="/error/500.html";
					}
					if(res.data.code==200){
						alert("修改成功！");
					}else{
						alert(res.data.msg);
					}
				});
			}
		},
	});
	</script>
</body>
</html>